package com.rain.rainspringboot3.encryption.factory;


import com.rain.rainspringboot3.encryption.strategy.EncryptionStrategy;
import com.rain.rainspringboot3.encryption.strategy.RSAEncryptionStrategy;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * RSA加密工厂
 * 创建RSA加密策略实例
 */
@Component
public class RSAEncryptFactory implements EncryptFactory {
    
    @Autowired
    private RSAEncryptionStrategy rsaEncryptionStrategy;
    
    @Override
    public EncryptionStrategy createStrategy() {
        return rsaEncryptionStrategy;
    }
    
    @Override
    public String getAlgorithmName() {
        return "RSA";
    }
}